package com.four.hospital.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.four.hospital.dao.HospitalDao;
import com.four.hospital.entity.Hospital;
import com.four.hospital.service.HospitalService;
import com.four.hospital.vo.HospitalVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author:luojie
 * @Date: 2022/01/05/18:39
 * @Description
 */
@Service
public class HospitalServiceImpl implements HospitalService {

    @Autowired
    private HospitalDao hospitalDao;

    /**
     * 医院分页模糊查
     * @param page
     * @param size
     * @param vo
     * @return
     */
    @Override
    public IPage<Hospital> hospitalList(Integer page, Integer size, HospitalVo vo) {
        Page<Hospital> hospitalPage=new Page<>(page,size);
        return hospitalDao.hospitalList(hospitalPage,vo);
    }

    /**
     * 输入医院名称查询医院信息
     * @param hosName
     * @return
     */
    @Override
    public List<Hospital> getHospitalByName(String hosName) {
        return hospitalDao.getHospitalByName(hosName);
    }
}
